Repository navigation
Failure backoff, opt-in cache sweep, Umbraco 18 publish leg - #36
Merged
Merged
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds failure backoff (R4), an opt-in cache age sweep (R6), and an Umbraco 18 leg in the publish gate (R8). No public member or signature changed.
What changed
CoalescingAudioSourceremembers failures. A failed key skips the engine forFailureBackoffSeconds(30) and gets the same 503. Auth failure (401/403) backs off all keys forAuthFailureBackoffSeconds(300), logged once per window. A 429 backs off all keys for Retry-After (capped at 300 s), elseFailureBackoffSeconds. Failure map is capped at 1000 keys, expired entries dropped first, then the oldest evicted.CacheMaxAgeDays(null default). A hosted service sweeps once a day in batches of 500 through a new optionalIAudioCacheSweep, whichDiskAudioCacheimplements.IAudioCacheis untouched.Design calls
SynthesisRejectedException(subclass ofInvalidOperationException, so existing catches still work) andSynthesisFailureKind. The Azure engine uses it for AuthenticationFailure, Forbidden and TooManyRequests. The Speech SDK gives no Retry-After, so Azure 429 usesFailureBackoffSeconds. A custom engine can passRetryAfter, and anHttpRequestExceptionwith 401, 403 or 429 is also recognised.CoalescingAudioSourcekeeps its public 4-argument constructor. A new internal one takes aTimeProviderfor tests.Proof
dotnet build tests/BaryoDev.Umbraco.ReadAloud.Tests -c Release: 0 Error(s)Round 2
AzureSpeechAdmintookCoalescingAudioSource, which buildsIAudioCacheand validatesReadAloudOptionsbefore a key is stored. The admin now takes a new internalBackoffResetSignalwith no dependencies and callsReset()after save and remove.CoalescingAudioSourcecompares the signal's generation at the start of each request and clears the global window and per-key map when it changed.dotnet build tests/BaryoDev.Umbraco.ReadAloud.Tests: 0 Error(s). Tests not run locally; CI runs them.